package net.zjitc.stack;

public class Demo {
    public static void main(String[] args) {
        int sum = fun(10);
        System.out.println(sum);
    }

    private static int getSum(int a, int b) {
        int max = getMax(a,b);
        return a+b;
    }

    private static int getMax(int a, int b) {
        return a>b?a:b;
    }

    //递归：1--10
    private static int fun(int n){
        if (n ==1){
            return 1;
        }
        return n+ fun(n-1);
    }

}
